<div class="content">
    <div class="layui-card txl">
        <div class="yg_left">
            <div class="title">部门信息 <span>共{$userCount}个员工</span><a class="tb_but btn-sync"><i class="fa fa-refresh"></i> 同步信息</a></div>
            <div id="channeltree"></div>
        </div>
        <div class="yg_right">
            <div class="search_box">
                <form id="post-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="POST" action="{:url('manage/address_book')}">
                    <div class="search_input">
                        <input type="hidden" name="page" value="1">
                        <input type="hidden" name="department_id" value="0">
                        <input type="text" name="nickname" placeholder="请输入员工姓名搜索…" class="layui-input">
                        <button type="submit" class="search_icon iconfont icon-sousuo"></button>
                    </div>
                    <div class="layui-form-item hide">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-inline">
                            <select name="status" lay-filter="status">
                                <option value="">请选择状态</option>
                                <option value="normal">正常</option>
                                <option value="hidden">锁定</option>
                            </select>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-card-body">
                <table class="layui-table" lay-skin="line" lay-even="">
                    <thead>
                    <tr>
                        <th width="150">姓名</th>
                        <th>部门</th>
                        <th>职位</th>
                        <th>账号</th>
                        <th>状态</th>
                        <th>手机号</th>
                        <th width="180">操作</th>
                    </tr>
                    </thead>
                    <tbody class="lists">
                    </tbody>
                </table>
                <div id="laypage"></div>
            </div>
        </div>
    </div>
</div>

<div class="pop cz_pop">
    <div class="pop_content">
        <form id="reset-form" class="layui-form" role="form" data-toggle="validator" method="POST" action="{:url('manage/changepwd')}">
            <div class="layui-card-header">重置密码</div>
            <div class="close iconfont icon-guanbi"></div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-label">新密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="newpassword" placeholder="请输入新密码" data-rule="required;password" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="renewpassword" placeholder="请再次输入新密码" data-rule="required;password" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="pop_but">
                <input type="hidden" name="uid" value="0">
                <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                <button type="submit" class="layui-btn layui-btn-determine">确定</button>
            </div>
        </form>
    </div>
</div>

<script type="text/html" id="list_tpl">
    <% for(i = 0; i < data.length; i ++) { %>
    <tr>
        <td>
            <div class="head_box">
                <div class="head_img"><img src="<%=data[i]['avatar']%>" alt=""/></div> <%=data[i]['nickname']%>
            </div>
        </td>
        <td><%=data[i]['department_name']%></td>
        <td><%=data[i]['position']%></td>
        <td><%=data[i]['username']%></td>
        <td>
            <div class="switch<% if (data[i]['status'] == 'normal') { %> active<% } %>"><div class="switch_handle"></div></div>
        </td>
        <td><%=data[i]['mobile']%></td>
        <td>
            <% if (data[i]['group_id'] == 1) { %>
            <a data-id="<%=data[i]['id']%>" data-value="2" class="switch_group">设为管理员</a>
            <% } else {%>
            <a data-id="<%=data[i]['id']%>" data-value="1" class="switch_group">取消管理员</a>
            <% } %>
            |
            <a data-id="<%=data[i]['id']%>" class="cz_but">重置手势密码</a>
        </td>
    </tr>
    <% } %>
</script>